#include "iofunctiontest.h"
#include "ui_iofunctiontest.h"
#include "common/common.h"
#include "outputtestitem.h"
#include "inputtestitem.h"

IOFunctionTest::IOFunctionTest(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::IOFunctionTest)
{
    ui->setupUi(this);
    setWindowFlags(Qt::FramelessWindowHint);
    setWindowState(Qt::WindowMaximized);
    initWidget();
}

IOFunctionTest::~IOFunctionTest()
{

    delete ui;
}

void IOFunctionTest::initWidget()
{
    int outItemCnt = outMgr->outputIoCount();
    for(int i = 0;i<outItemCnt;++i)
    {
        OutputTestItem* item = new OutputTestItem(outMgr->getOutput(i),this);
        ui->gridLayout->addWidget(item,i/4,i%4,1,1);
    }
    int inItemCnt = inMgr->inputIoCount();
    for(int i = 0;i<inItemCnt;++i)
    {
        InputTestItem* item = new InputTestItem(inMgr->getInput(i),this);
        ui->gridLayout_2->addWidget(item,i/4,i%4,1,1);
    }
}

void IOFunctionTest::on_btn_back_clicked()
{
    this->deleteLater();
}
